<{include file="../common/form.tpl"}>
	
<script type="text/javascript">
    $(function(){
    	
    	$('#radio-accadmin-1').on('ifChecked', function(event){
    		$('select[name="user[RoleID]"]').prop("disabled", true);
    		$('.table tbody tr').eq(7).hide();
        });
        
    	$('#radio-accadmin-2').on('ifChecked', function(event){
    		$('select[name="user[RoleID]"]').prop("disabled", false);
    		$('.table tbody tr').eq(7).show();
        });
    	
    	
    	$('input[name="sub"]').click(function(){
        	var name = $('input[name="user[account]"]').val();        	
        	if(name == ''){
        		layer.alert('请填写账号', {icon: 2, skin: ''});
            	return false;
        	}
        	
        	var username = $('input[name="user[username]"]').val();        	
        	if(username == ''){
        		layer.alert('请填写用户名', {icon: 2, skin: ''});
            	return false;
        	}
        	
        	var password = $('input[name="user[password]"]').val();        	
        	if(password == ''){
        		layer.alert('请填写密码', {icon: 2, skin: ''});
            	return false;
        	}
        	
        	var RoleID = $('select[name="user[RoleID]"]').val(); 
        	if(RoleID == ''){
        		layer.alert('请选择角色', {icon: 2, skin: ''});
            	return false;
        	}
        	    
       });
    });
</script>